import java.util.List;

public class Displayer {

    /**
     * 打印主界面提示信息
     */
    public static void printMainFrame() {
        System.out.println("   在线考试系统");
        System.out.println("-------------------");
        System.out.println("  （1）登录");
        System.out.println("  （2）考生注册");
        System.out.println("  （3）管理员注册");
        System.out.println("  （0）退出系统");
        System.out.println("-------------------");
    }

    public static void printAdminFrame(String name) {
        System.out.println("-----------------------");
        System.out.println("    管理员面板");
        System.out.println("             —— "+name);
        System.out.println("-----------------------");
        System.out.println("（1）学员管理模块");
        System.out.println("（2）考题管理模块");
        System.out.println("（0）退出登录");
    }

    public static void printStudentManageModuleFrame() {
        System.out.println("--------------------");
        System.out.println("    学员管理模块");
        System.out.println("--------------------");
        System.out.println("   （1）增加学员");
        System.out.println("   （2）删除学员");
        System.out.println("   （3）修改学员");
        System.out.println("   （4）查找学员");
        System.out.println("   （0）返回");
    }

    public static void printQuestionManageModuleFrame() {
        System.out.println("---------------------");
        System.out.println("    考题管理模块");
        System.out.println("---------------------");
        System.out.println("   （1）增加考题");
        System.out.println("   （2）删除考题");
        System.out.println("   （3）修改考题");
        System.out.println("   （4）查找考题");
        System.out.println("   （5）导入考题");
        System.out.println("   （0）返回");
    }

    public static void printStudentFrame(String name) {
        System.out.println("--------------------");
        System.out.println("    学生面板");
        System.out.println("           —— "+name);
        System.out.println("--------------------");
        System.out.println("（1）用户模块");
        System.out.println("（2）考试模块");
        System.out.println("（0）退出登录");
    }

    public static void printUserModuleFrame() {
        System.out.println("------------------");
        System.out.println("    用户模块");
        System.out.println("------------------");
        System.out.println("（1）修改昵称");
        System.out.println("（2）修改密码");
        System.out.println("（0）返回");
    }

    public static void printExamModuleFrame() {
        System.out.println("------------------");
        System.out.println("    考试模块");
        System.out.println("------------------");
        System.out.println("（1）开始考试");
        System.out.println("（2）查询成绩");
        System.out.println("（3）导出成绩");
        System.out.println("（0）返回");
    }


    public static void printOneTrueOrFalseQuestion(TrueOrFalseQuestion question, int questionIndex) {
        System.out.println("("+questionIndex+") "+"判断题:"+question.getQuestion()+" true/false?");
    }
    public static void printOneChoiceQuestion(ChoiceQuestion question, int questionIndex) {
        System.out.println("("+questionIndex+") "+"选择题:"+question.getQuestion());
        System.out.print("A. "+question.optionA);
        System.out.print("    B. "+question.optionB);
        System.out.print("    C. "+question.optionC);
        System.out.println("    D. "+question.optionD);
    }

    public static void printAllChoiceQuestions(List<ChoiceQuestion> choiceQuestions) {
        System.out.println("---------------------------");
        System.out.println("         选择题库");
        System.out.println("---------------------------");
        int i = 0;
        for (ChoiceQuestion item : choiceQuestions) {
            Displayer.printOneChoiceQuestion(item, ++i);
        }
    }

    public static void printAllTrueOrFalseQuestions(List<TrueOrFalseQuestion> trueOrFalseQuestions) {
        System.out.println("---------------------------");
        System.out.println("         判断题库");
        System.out.println("---------------------------");
        int i = 0;
        for (TrueOrFalseQuestion item : trueOrFalseQuestions) {
            Displayer.printOneTrueOrFalseQuestion(item, ++i);
        }
    }
//    public static void printLoginFrame() {
//        System.out.println();
//        System.out.print("请输入账号密码:");
//    }

}
